package org.lee.handle.impl;

import lombok.extern.slf4j.Slf4j;
import org.lee.handle.HandlerInterceptor;

/**
 * SsoInterceptor
 *
 * @author dralee
 * @date 2021-11-22 16:37:26
 **/
@Slf4j
public class SsoInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(String request, String response, Object handler) {
        if (request.length() < 11) {
            log.warn("非法请求：{}", request);
            return false;
        }
        String token = request.substring(1, 10);
        return token.equals("helloword");
    }
}
